package com.yt.dor.service;

import com.yt.dor.models.vo.HygieneScoreVO;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.BeanUtils;
import javax.annotation.Resource;
import com.yt.dor.common.config.YmlConfig;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yt.dor.mapper.HygieneScoreMapper;
import com.yt.dor.models.service.IHygieneScoreService;
import com.yt.dor.models.bo.HygieneScoreSaveBO;
import com.yt.dor.models.dto.HygieneScoreDTO;

import java.util.List;

/**
 * 评分详情控制器
 *
 * @author thekai
 * @Date 2025-11-04 09:29:26
 */
@DubboService
public class HygieneScoreServiceImpl extends ServiceImpl<HygieneScoreMapper, HygieneScoreDTO> implements IHygieneScoreService{

    @Resource
    private YmlConfig ymlConfig;
    @Resource
    private HygieneScoreMapper hygieneScoreMapper;

    @Override
    public boolean add(HygieneScoreSaveBO saveBO) {
        HygieneScoreDTO dto = new HygieneScoreDTO();
        BeanUtils.copyProperties(saveBO,dto);
        Long id = ymlConfig.getPkId();
        dto.setId(id);
        return this.insert(dto);
    }
    @Override
    public List<HygieneScoreVO> query() {
        List<HygieneScoreVO> hygieneScoreVOS=hygieneScoreMapper.query();
        return hygieneScoreVOS;
    }
}
